﻿#include "converter.h"

Converter::Converter(QObject *parent) : QObject(parent)
{

}

void Converter::mat2pixmap(const cv::Mat& mat)
{
    cv::Mat resizeMat;
    resize(mat, resizeMat, cv::Size(640,640), 0, 0, cv::INTER_NEAREST);
    QPixmap pixmap = QPixmap::fromImage(QImage(resizeMat.data,
                                               resizeMat.rows,
                                               resizeMat.cols,
                                               QImage::Format_Grayscale16)
                                        );
    emit out_pixmap(pixmap);
}
